home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / leocom.zip / LEOCOM.DOC next >
Text File  |  1991-08-06  |  4KB  |  129 lines

  1.                            LEOCOM 1.0
  2.  
  3.      LEOCOM is a collection of routines used for asyncronous
  4. communications on the IBM PC.
  5.  
  6. (C) Copyright 1991 by Leo Bicknell, All Rights Reserved.
  7.  
  8.      This version is compiled for Turbo C++, small memory model.
  9.  
  10.      This library is for test and evaluation purposes.  It may
  11. not be used in any Copyrighted programs of any kind, and many not
  12. be used in any programs designed to be sold or liscened.
  13.  
  14.      Registering this library will allow you to recompile for any
  15. memory model, and make modifications to suit your specific needs. 
  16. Registration also allows you to use this library royality free in
  17. any commercial or shareware program.  Registered users will also
  18. be elligable for low cost upgrades to the next version.  To
  19. register complete the form in REGISTER.DOC. 
  20.  
  21.      If you have any questions, comments, or suggestions I can be
  22. reached on The Apollo III BBS (716) 896-6409 HST, or you can send
  23. a letter US SNAIL to:
  24.  
  25.      Leo Bicknell
  26.      46 Foxhunt Lane
  27.      East Amherst, NY 14051
  28.  
  29.      Please allow at least 2 days for a responce on the BBS, and
  30. 2 weeks for a responce by SNAIL.
  31. ---
  32.  
  33.      Now for the actual library.  With this version I am not able
  34. to fully expand on all of the public varables, that will be in
  35. the next version with better documentation.  This should be all
  36. the information you need to get your program up and running
  37. though.
  38.  
  39. ---
  40. void      mclear(void);
  41.  
  42.      Clears the incomming buffer.
  43.  
  44. ---
  45. int       mclose(void);
  46.  
  47.      Shutdown the communication package, a call to MOPEN must
  48. have been prevously made, otherwise undefined results will occur.
  49.  
  50. ---
  51.         THIS FUNCTION MUST BE CALLED BEFORE ALL OTHERS!!!!!
  52.  
  53. int  mopen(int baud, int word, int parity, int stop, int BASE,
  54.            int VECTOR, int MASK);
  55.  
  56.      baud    - Baud rate divisor
  57.      word    - Word length
  58.      parity  - Parity setting
  59.      stop    - Stop bits
  60.      BASE    - Com port base address
  61.      VECTOR  - Interrupt vector number
  62.      MASK    - 8259 PIC comtroller mask
  63.  
  64.      These are all provided to allow maximum flexability in the
  65. package.  Definitions for baud, word, parity, and stop can all be
  66. found in LEOCOM.H.  For standard com ports:
  67.  
  68.         COM1            COM2
  69. BASE    0x3f8           0x2f8
  70. VECTOR  12              11
  71. MASK    IM4             IM3
  72.  
  73.         Baud rate divisor can be calculated by the formula:
  74.  
  75.         divisor = (int)(115200l / long_desired_baud_rate);
  76.  
  77.         Word length can be DATA8, DATA7, DATA6, or DATA5,
  78. representing 8, 7, 6, or 5 data bits, respectively.
  79.  
  80.         Parity can be PNONE, PEVEN, or PODD, representing no,
  81. even, and odd parity, respectively.
  82.  
  83.         Stop can be STOP1 or STOP2 representing 1 or 2 stop bits,
  84. respectively.
  85.  
  86.         RETURNS: mopen will return TRUE or FALSE (defined in
  87. LEOCOM.H).  On false return a FATAL error has occured.
  88.  
  89. ---
  90. int       mputs(char *s);
  91.  
  92.      Send a string to the com port.  Port must have been
  93. prevously opened by MOPEN.
  94.  
  95.      RETURNS: Number of charactors sent, or 0 if error.
  96.  
  97. ---
  98. int       mputc(int c);
  99.  
  100.      Send a charactor to the com port.  Port must have been
  101. prevously opened by MOPEN.
  102.  
  103.      RETURNS: TRUE is sent, FALSE if send error.
  104.  
  105. ---
  106. int       mgetc(void);
  107.  
  108.      Get a charactor.  Will automatically return scan code value
  109. on DOORWAY mode keys. Port must have been prevously opened by
  110. MOPEN.
  111.      RETURNS: ASCII or SCAN code.
  112. ---
  113. void      msdtr(int state);
  114.  
  115.      Set DTR to LOW or HIGH (defined in LEOCOM.H).  Port must
  116. have been prevously opened by MOPEN.
  117.  
  118. ---
  119. void msrts(int state);
  120.  
  121.      Set RTS to LOW or HIGH (defined in LEOCOM.H).  Port must
  122. have been prevously opened by MOPEN.
  123.  
  124. ---
  125. void msbreak(void);
  126.  
  127.      Send a break over the com port.  Port must have been
  128. prevously opened by MOPEN.
  129.